5. HOB Code Definitions 您所在的位置:网站首页 efi system volume information 5. HOB Code Definitions

5. HOB Code Definitions

2024-05-30 12:10| 来源: 网络整理| 查看: 265

5.4.1.1. EFI_HOB_MEMORY_ALLOCATION¶

Summary

Describes all memory ranges used during the HOB producer phase that exist outside the HOB list. This HOB type describes how memory is used, not the physical attributes of memory.

Prototype

typedef struct _EFI_HOB_MEMORY_ALLOCATION { EFI_HOB_GENERIC_HEADER Header; EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor; // // Additional data pertaining to the “Name” Guid memory // may go here. // } EFI_HOB_MEMORY_ALLOCATION;

Parameters

Header

The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION .

AllocDescriptor

An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the various attributes of the logical memory allocation. The type field will be used for subsequent inclusion in the UEFI memory map. Type EFI_HOB_MEMORY_ALLOCATION_HEADER is defined in “Related Definitions” below.

Description

The memory allocation HOB is used to describe memory usage outside the HOB list. The HOB consumer phase does not make assumptions about the contents of the memory that is allocated by the memory allocation HOB, and it will not move the data unless it has explicit knowledge of the memory allocation HOB’s Name (EFI_GUID). Memory may be allocated in either the HOB producer phase memory area or other areas of present and initialized system memory.

The HOB consumer phase reads all memory allocation HOBs and allocates memory into the system memory map based on the following fields of EFI_HOB_MEMORY_ALLOCATION_HEADER of each memory allocation HOB:

MemoryBaseAddress

MemoryLength

MemoryType

The HOB consumer phase does not parse the GUID-specific data identified by the Name field of each memory allocation HOB, except for a specific set of memory allocation HOBs that defined by this specification. A HOB consumer phase driver that corresponds to the specific Name GUIDed memory allocation HOB can parse the HOB list to find the specifically named memory allocation HOB and then manipulate the memory space as defined by the usage model for that GUID.

Note: Special design care should be taken to ensure that two HOB consumer phase components do not modify memory space that is described by a memory allocation HOB, because unpredictable behavior might result.

This specification defines a set of memory allocation HOBs that are architecturally used to allocate memory used by the HOB producer and consumer phases. Additionally, the following memory allocation HOBs are defined specifically for use by the final stage of the HOB producer phase to describe the processor state prior to handoff into the HOB consumer phase:

BSP stack memory allocation HOB

BSP store memory allocation HOB

Memory allocation module HOB

//****************************************************** // EFI_HOB_MEMORY_ALLOCATION_HEADER //****************************************************** typedef struct _EFI_HOB_MEMORY_ALLOCATION_HEADER { EFI_GUID Name; EFI_PHYSICAL_ADDRESS MemoryBaseAddress; UINT64 MemoryLength; EFI_MEMORY_TYPE MemoryType; // UINT32 UINT8 Reserved[4]; // Padding for Itanium® // processor family } EFI_HOB_MEMORY_ALLOCATION_HEADER; Name

A GUID that defines the memory allocation region’s type and purpose, as well as other fields within the memory allocation HOB. This GUID is used to define the additional data within the HOB that may be present for the memory allocation HOB. Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 specification.

MemoryBaseAddress

The base address of memory allocated by this HOB. Type EFI_PHYSICAL_ADDRESS is defined in AllocatePages() in the UEFI 2.0 specification.

MemoryLength

The length in bytes of memory allocated by this HOB.

MemoryType

Defines the type of memory allocated by this HOB. The memory type definition follows the EFI_MEMORY_TYPE definition. Type EFI_MEMORY_TYPE is defined in AllocatePages() in the UEFI 2.0 specification.

Reserved For this version of the specification, this field will always be set to zero.

Note: MemoryBaseAddress and MemoryLength must each have 4-KiB granularity to meet the page size requirements of UEFI.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有